#include<iostream>
#include<set>
using namespace std;
set<int>S;
int n;
int main()
{
	cin >> n;
	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		S.insert(x);
	}
	cout << S.size() << endl;
	for (int x : S) {
		cout << x << " ";
	}
	return 0;
}
